Skip to content

Sublime freezes whan I try to format large css file. #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maxonik opened this issue Nov 16, 2018 · 4 comments
Closed

Sublime freezes whan I try to format large css file. #147

maxonik opened this issue Nov 16, 2018 · 4 comments
Labels

Comments

@maxonik
Copy link

maxonik commented Nov 16, 2018

Please try to format this file http://silentcode.org/bitrix/cache/css/s1/main/template_6fb3afcdea0e0b842910d8990e319c2a/template_6fb3afcdea0e0b842910d8990e319c2a.css?148381411788539 and see what happen.
My Sublime freezes
Its ok if I format online here https://prettier.io/playground/
And works fine in Visual studio code

thanks for help!

@jonlabelle
Copy link
Owner

jonlabelle commented Nov 22, 2018

I actually noticed this also, freezing of minified (one line files) and or larger files. However, when I ran the same file(s) directly against prettier, same result... nodejs just churned and churned as it did in ST.

I think i tracked it down to cursor offset getting hung up somewhere - not being able to calculate the proper position.

May @kaste can take a look and see if he can reproduce (ala PR #120); and we send it off to Prettier as defect to investigate.

@kaste
Copy link
Contributor

kaste commented Nov 24, 2018

So the use case here is basically to unuglify built files?

For Sublime, reading or setting the cursor is no problem. Only writing to the Sublime built-in console is super slow and it will in fact freeze Sublime if you for example log file contents or larger diffs to it. So you always have to make sure no debugging logger is attached to the console. (E.g. you have noticable delays even for moderately small files if you run SublimeLinter in debug mode.)

However, if you already managed to reproduce it on the cli then it's seems of course to be a bug on prettier's side.

@jonlabelle
Copy link
Owner

It's definitely not an issue with Sublime Text (or the JsPrettier plug-in).

I've attached a small demo which reproduces the issue from the CLI. Assuming you're on macOS or Linux; download and extract the zip... then run bash prettier-cli.sh.

@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants